import axios from 'axios'
export default {
	// 工厂函数模式  独立模块的作用域  
	state() {
		return {
			count: 1,
			books: [],
			todos: [{
					id: 1,
					text: "睡觉",
					done: true
				},
				{
					id: 2,
					text: "吃饭",
					done: false
				},
				{
					id: 3,
					text: "敲代码",
					done: false
				},
				{
					id: 4,
					text: "打豆豆",
					done: false
				}
			]
		}
	},
	mutations: {

	},
	getters: {
		FilterNoArg(selfState, Getters, All) {
			console.log(selfState)
			console.log(Getters)
			console.log(All.moduleB.ageB)
			return selfState.todos.filter(v => !v.done)
		},
		// 返回的是 函数方法 是无效的↓
		FilterHaveArg: state => arg => state.todos.filter(v => v.done == arg)

	},
	actions: {
		getData(store) { //本模块的的store
			console.log(store)
		}
	},
	modules: {

	},
	namespaced: true, //标注所属仓库模块
}
